package com.pipayshop.service.impl;

import com.alibaba.druid.util.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pipayshop.entity.*;
import com.pipayshop.entity.dto.UserByZoneInvitationCodeDTO;
import com.pipayshop.entity.vo.*;
import com.pipayshop.exception.BusinessException;
import com.pipayshop.mapper.*;
import com.pipayshop.service.UserInfoService;
import com.pipayshop.service.WithdrawalCommissionService;
import com.pipayshop.service.ZoneService;
import com.pipayshop.utils.InviteCodeGenerator;
import com.pipayshop.utils.SnowflakeIdGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;

@Service
public class WithdrawalCommissionServiceImpl extends ServiceImpl<WithdrawalCommissionMapper, WithdrawalCommission> implements WithdrawalCommissionService {

    @Autowired
    private WithdrawalCommissionMapper withdrawalCommissionMapper;

    @Override
    public List<WithdrawalCommission> selectAll() {
        return withdrawalCommissionMapper.selectAll();
    }

    @Override
    public WithdrawalCommission selectById(Integer id) {
        return withdrawalCommissionMapper.selectById(id);
    }

    @Override
    public boolean insert(WithdrawalCommission withdrawalCommission) {
        int insert = withdrawalCommissionMapper.insert(withdrawalCommission);
        if (insert != 0) {
            return true;
        }
        return false;
    }

    @Override
    public boolean deleteById(Long id) {
        int i = withdrawalCommissionMapper.deleteId(id);
        if (i != 0) {
            return true;
        }
        return false;
    }
}
